#include <stdio.h>
#include <stdlib.h>
#include "tree.h"

	tree_st *create()
{
	tree_st *tree = NULL;
	while(1)
	{
		char data;
		scanf("%c",&data);
		if(data == '#')
			break;
		tree_insert(&tree,data);
	}
	return tree;
}
	void travel(tree_st *ptr)
{
	printf("----------\n");
	first_show(ptr);
	printf("\n----------\n");
	middle_show(ptr);
	printf("\n----------\n");
	last_show(ptr);
	printf("\n----------\n");
	level_show(ptr);
	printf("\n");
}

	int main()
{
	tree_st *tree = NULL;
	tree = create();
	tree_draw(tree);
//	firstShow(tree);
	
//	printf("%d\n",getDepth(tree));
//	travel(tree);
	tree_balance(&tree);
	tree_draw(tree);
/*
	char data = 'd';
	tree_delete(&tree,data);
	printf("\n\n");
	tree_draw(tree);
*/	
		exit(0);
}
